<template>
<div class="hot-tag">
  <span class="tag-item" v-for="(item, index) in tagList" :key="index"><a href="">{{item.tagName}}</a></span>
</div>
</template>

<script>
import {request} from 'network/request'
export default{
  name: 'hotTag',
  data () {
    return {
      tagList: []
    }
  },
  mounted(){
    this.getTagList();
  },
  methods: {
    getTagList(){
      request({
        url: '/tag/getTagList',
        method: 'get'
      }).then(response => {
        this.tagList = response.data
      }).catch(error => {
        this.$message.error('请求标签列表数据失败');
              }
      )
    }
  }
}
</script>

<style scoped>
.hot-tag{
  border-top: 1px solid #cfcece;
  display: flex;
  flex-wrap: wrap;
  background-color: #f7f7f7;
  padding: 15px;
  margin-top: 10px;
}
.tag-item{
  border: 1px solid #d1d1d1;
  border-radius: 5px;
  padding: 8px 10px;
  margin: 0 14px 14px 0;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
}
</style>
